/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.model.entity.estoque;

import br.com.loja.model.entity.Switchable;
import br.com.loja.view.swing.model.FormField;
import br.com.loja.view.swing.model.IgnoreTableModel;
import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author David Luiz
 */
@Entity
@Table(name = "alteracao_item_estoque")
public class AlteracaoItemEstoque implements Switchable, Serializable {

    public static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idAlteracaoItemEstoque;
    @ManyToOne
    private ItemEstoque itemEstoque;
    @Temporal(TemporalType.DATE)
    private Calendar dataAlteracao;
    private Integer quantidade;
    @Enumerated(EnumType.STRING)
    private Causa causa;

    @FormField(visible = false)
    @IgnoreTableModel
    private boolean dead;

    public AlteracaoItemEstoque() {
    }

    /**
     * @return the idAlteracaoItemEstoque
     */
    public Long getIdAlteracaoItemEstoque() {
        return idAlteracaoItemEstoque;
    }

    /**
     * @param idAlteracaoItemEstoque the idAlteracaoItemEstoque to set
     */
    public void setIdAlteracaoItemEstoque(Long idAlteracaoItemEstoque) {
        this.idAlteracaoItemEstoque = idAlteracaoItemEstoque;
    }

    /**
     * @return the itemEstoque
     */
    public ItemEstoque getItemEstoque() {
        return itemEstoque;
    }

    /**
     * @param itemEstoque the itemEstoque to set
     */
    public void setItemEstoque(ItemEstoque itemEstoque) {
        this.itemEstoque = itemEstoque;
    }

    /**
     * @return the dataAlteracao
     */
    public Calendar getDataAlteracao() {
        return dataAlteracao;
    }

    /**
     * @param dataAlteracao the dataAlteracao to set
     */
    public void setDataAlteracao(Calendar dataAlteracao) {
        this.dataAlteracao = dataAlteracao;
    }

    /**
     * @return the quantidade
     */
    public Integer getQuantidade() {
        return quantidade;
    }

    /**
     * @param quantidade the quantidade to set
     */
    public void setQuantidade(Integer quantidade) {
        this.quantidade = quantidade;
    }

    /**
     * @return the causa
     */
    public Causa getCausa() {
        return causa;
    }

    /**
     * @param causa the causa to set
     */
    public void setCausa(Causa causa) {
        this.causa = causa;
    }

    @Override
    public boolean isDead() {
        return dead;
    }

    @Override
    public void setDead(boolean dead) {
        this.dead = dead;
    }

}
